package com.spukmk3me.impl.libgdx;

import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputProcessor;
import com.spukmk3me.io.userinput.ButtonInput;

public class LibgdxButtonInput extends ButtonInput implements InputProcessor
{
    @Override
    public boolean keyDown( int keycode )
    {
        switch ( keycode )
        {
            case Keys.BACK:
            case Keys.BACKSPACE:
                applyPressData( KC_BACK, true );
                break;
        }
        
        return true;
    }

    @Override
    public boolean keyUp( int keycode )
    {
        switch ( keycode )
        {
            case Keys.BACK:
            case Keys.BACKSPACE:
                applyPressData( KC_BACK, false );
                break;
        }

        return true;
    }

    @Override
    public boolean keyTyped( char character )
    {
        return true;
    }

    @Override
    public boolean touchDown( int x, int y, int pointer, int button )
    {
        return false;
    }

    @Override
    public boolean touchUp( int x, int y, int pointer, int button )
    {
        return false;
    }

    @Override
    public boolean touchDragged( int x, int y, int pointer )
    {
        return false;
    }

    @Override
    public boolean mouseMoved( int x, int y )
    {
        return false;
    }

    @Override
    public boolean scrolled( int amount )
    {
        return false;
    }
    
    public static final int KC_BACK = 0x00000001;
}
